function HandlePageBackendCouriers(gui, operator, now, options) {
  this._gui = gui;
  this._operator = operator;
  this._now = now;
  this._options = options;
  
  this._createElements();
};

HandlePageBackendCouriers.prototype._createElements = function() {
  this._gui.add.onclick = function() { location.href = '?p=pagefactory&t=pagebackendcourier&m=' + JSON.stringify({ a: 2, b: 2 }); };
  this._loadData();
};

HandlePageBackendCouriers.prototype._loadData = function() {
  var tr, td;
  tr = this._gui.result.insertRow(-1);
  td = tr.insertCell(-1);
  td.appendChild(DOMUtils.getLoadingImage());
  
  this._couriers = null;
  this._retrieveCouriers();
};

HandlePageBackendCouriers.prototype._verifyData = function() {
  if (this._couriers) {
    this._updateElements();
  }
};

HandlePageBackendCouriers.prototype._retrieveCouriers = function(page, condition, date, from, to, pos) {
  var _self = this;
  /*new RequestUtils()._read('icourier', null, null, null, null, 'd.name', null, function(result, params) { _self._couriers = result.data;
                                                                                                          _self._verifyData.call(_self);
                                                                                                        }, null);
*/

  new RequestUtils()._mysql('icourier', null, function(result, params) { _self._couriers = result.data;
                                                                          _self._parameters = result;
                                                                          _self._verifyData.call(_self);
                                                                        }, {php:'customphp/mysqlread.php',pos: (pos) ? pos : null });     

};

HandlePageBackendCouriers.prototype._updateElements = function() {
  var tr, td, _self = this;
  DOMUtils.removeTableRows(this._gui.result, 1);
  
  if (this._couriers.length == 0) {
    tr = this._gui.result.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan = 2;
    td.style.height = '24px';
    td.style.textAlign = 'center';
    td.style.backgroundColor = '#fff';;
    td.appendChild(document.createTextNode('N/A'));
  }
  
  MiscUtils.sort(this._couriers, ['name']);
  for(var i = 0, il = this._couriers.length; i < il; i++) {
    var r = this._couriers[i];
    
    tr = this._gui.result.insertRow(-1);
    new ITableRowCourier(tr, r, {callbackFunc: function() { _self._createElements(); } });
  }
};

